package com.taiji.dicom4cloud.smart.rfid.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.TextMessage;

/**
 * @Description
 * @Author fanxl
 * @Date 2021/7/29
 **/
@Component
public class Consumer {
    @Value("${spring.mqtt.default.topic}")
    private String defaultTopic;


    @JmsListener(destination = "defaultTopic")
    public void receive(TextMessage textMessage) throws JMSException {
        System.out.println("接收到topic消息-->"+textMessage.getText());
    }
}
